

**************************************************************
** Replication files for Martel-Morin and Lachapelle. 2022	**
** Published in PLOS One								    **
** Date : September 2022								    **
**************************************************************

*Load the dataset
use "fivecanadas_main_data.dta", clear

**************************************************************
** 						Preparation							**	
**************************************************************

*Label variables 


label variable certainty "Certainty GW is occurring"
label variable hum "Human causation"
label variable risk "Personal risk perception"
label variable timing "Timing of harm to Canadians"
label variable know "Knowledge"
label variable symp "Attitude toward the environmental movement"
label variable cc_vote "Importance of CC for electoral decisions"
label variable discuss "CC discussion frequency"
label variable press_gov "Contacted government officials about mitigation"
label variable boycott "Rewarded/punished companies that are/are not reducing emissions"
label variable energy "Reduced household's use of energy"
label variable resp "Primary responsibility for paying the costs of cc"
label variable comp_account "Support for holding companies accountable"

label variable fivecanada "Five Canadas of Climate Change"

label variable cue "Options for revenue use and messaging"
label variable price "Price"
label variable cue_lowprice "Options for revenue use and messaging x low price"
label variable cue_highprice "Options for revenue use and messaging x high price"
label variable inv_rel "Equal dividend vs invest in solutions/relative price"

label variable eff "Carbon tax perceived efficacy"
label variable fair "Carbon tax perceived fairness"
label variable posttax "Willingness to pay the carbon tax"
label variable index "Carbon tax support"

label variable gender "Gender"
label variable education "Education"
label variable age_num "Age"
label variable language "Language"
label variable province "Province"
label variable votefed "Party identification"
label variable interest_pol "Interest in politics"
label variable ideology "Ideology"
label variable ideology_ns "Ideology including not sure/refused"


**************************************************************
** 						Main analyses						**	
**************************************************************

* Table 2
** see Latent Gold results ("4 classes_results.html", "5 classes_results.html", "6 classes_results.html")

* Table 4
tabstat index, statistics(mean sd N) by(cue_lowprice)
tabstat index if fivecanada==4, statistics(mean sd N) by(cue_lowprice)
tabstat index if fivecanada==3, statistics(mean sd N) by(cue_lowprice)
tabstat index if fivecanada==2, statistics(mean sd N) by(cue_lowprice)
tabstat index if fivecanada==1, statistics(mean sd N) by(cue_lowprice)
tabstat index if fivecanada==0, statistics(mean sd N) by(cue_lowprice)
tabstat index, statistics(mean sd N) by(cue_highprice)
tabstat index if fivecanada==4, statistics(mean sd N) by(cue_highprice)
tabstat index if fivecanada==3, statistics(mean sd N) by(cue_highprice)
tabstat index if fivecanada==2, statistics(mean sd N) by(cue_highprice)
tabstat index if fivecanada==1, statistics(mean sd N) by(cue_highprice)
tabstat index if fivecanada==0, statistics(mean sd N) by(cue_highprice)

* Table 5
asdoc reg index i.cue ideology if price==0, replace nested setstars(*@.05, **@.01, ***@.001)
asdoc reg index i.cue ideology if price==1, nest keep(1.cue 2.cue 3.cue _cons) setstars(*@.05, **@.01, ***@.001)
asdoc reg index i.cue ideology b0.fivecanada if price==0, nest keep(1.cue 2.cue 3.cue 1.fivecanada 2.fivecanada 3.fivecanada 4.fivecanada ideology _cons) setstars(*@.05, **@.01, ***@.001)
asdoc reg index i.cue ideology b0.fivecanada if price==1, nest keep(1.cue 2.cue 3.cue 1.fivecanada 2.fivecanada 3.fivecanada 4.fivecanada ideology _cons) setstars(*@.05, **@.01, ***@.001)
asdoc reg index i.cue##b0.fivecanada ideology if price==0, nest keep(1.cue 2.cue 3.cue 1.fivecanada 2.fivecanada 3.fivecanada 4.fivecanada 1.cue#1.fivecanada 1.cue#2.fivecanada 1.cue#3.fivecanada 1.cue#4.fivecanada 2.cue#1.fivecanada 2.cue#2.fivecanada 2.cue#3.fivecanada 2.cue#4.fivecanada 3.cue#1.fivecanada 3.cue#2.fivecanada 3.cue#3.fivecanada 3.cue#4.fivecanada ideology _cons) setstars(*@.05, **@.01, ***@.001) 
asdoc reg index i.cue##b0.fivecanada ideology if price==1, nest keep(1.cue 2.cue 3.cue 1.fivecanada 2.fivecanada 3.fivecanada 4.fivecanada 1.cue#1.fivecanada 1.cue#2.fivecanada 1.cue#3.fivecanada 1.cue#4.fivecanada 2.cue#1.fivecanada 2.cue#2.fivecanada 2.cue#3.fivecanada 2.cue#4.fivecanada 3.cue#1.fivecanada 3.cue#2.fivecanada 3.cue#3.fivecanada 3.cue#4.fivecanada ideology _cons) setstars(*@.05, **@.01, ***@.001)

* Figure 1
quietly reg index i.cue_lowprice##b0.fivecanada ideology
margins, dydx(cue_lowprice) at(fivecanada=(0 1 3 4)) post
mplotoffset, plotopts(connect(none)) offset(0.3) noseparator recast(dot) level (95) horizontal xline(0)  title ("Figure 1") xtitle("Marginal effects on attitudes toward carbon pricing")

* Figure 2
quietly reg index i.cue_highprice##b0.fivecanada ideology
margins, dydx(cue_highprice) at(fivecanada=(0 1 3 4)) post
mplotoffset, plotopts(connect(none)) offset(0.3) noseparator recast(dot) level (95) horizontal xline(0)  title ("Figure 2") xtitle("Marginal effects on attitudes toward carbon pricing")


**************************************************************
** 				Supplementary Material						**	
**************************************************************

* Table S1
oneway gender cue_lowprice, tabulate
oneway education cue_lowprice, tabulate
oneway age_num cue_lowprice, tabulate

oneway gender cue_highprice, tabulate
oneway education cue_highprice, tabulate
oneway age_num cue_highprice, tabulate

* Table S2
pca eff fair posttax, correlation 
screeplot, title ("Index") 

pca eff fair posttax, factors(1) mine(0) correlation
rotate, varimax normalize blanks(0.2)

alpha eff fair posttax, i

* Table S3
asdoc reg index b0.price ideology, replace nested setstars(*@.05, **@.01, ***@.001)
asdoc reg index b0.price b0.fivecanada ideology, nest keep(1.price 1.fivecanada 2.fivecanada 3.fivecanada 4.fivecanada ideology _cons) setstars(*@.05, **@.01, ***@.001)
asdoc reg index b0.price##b0.fivecanada ideology, nest keep(1.price 1.fivecanada 2.fivecanada 3.fivecanada 4.fivecanada 1.price#1.fivecanada 1.price#2.fivecanada 1.price#3.fivecanada 1.price#4.fivecanada ideology _cons) setstars(*@.05, **@.01, ***@.001)

* Table S4
asdoc reg eff inv_rel##b1.price ideology if fivecanada==4, setstars(***@.001, **@.01, *@.05)

* Table S5-S7
** See Latent Gold results ("5 classes_results.html", section "Profile")

* Table S8
tab gender fivecanada, col
tab language fivecanada, col 
tab province fivecanada, col 
tab interest_pol fivecanada, col
tab ideology_ns fivecanada, col
tab education fivecanada, col 
